<template>
  <div class="sonson">
    <h3>孙子组件</h3>
    <h4>爷爷的钱：{{ money }}</h4>
    <button @click="changeMoney(500)">消费</button>
  </div>
</template>

<script>
import { inject } from 'vue'
export default {
  setup() {
    const money = inject('money')
    const changeMoney = inject('changeMoney')
    return { money, changeMoney }
  },
}
</script>

<style></style>
